package com.tianql.service;

import com.tianql.mapper.AccountMapper;
import org.apache.seata.core.context.RootContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author 田起立
 * @Date 2024/6/11 16:03
 * @Description:
 */
@Service
public class AccountServiceImpl {
    @Autowired
    private AccountMapper accountMapper;

    public String debit(String userId, int money) {
        String xid = RootContext.getXID();
        accountMapper.debit(userId, money);
        return "扣除用户钱数";
    }
}
